package com.zhixing.web.api.controller;

import com.zhixing.web.api.annotation.Log;
import com.zhixing.web.api.dataobject.entity.Rotation;
import com.zhixing.web.api.dataobject.untils.ResultVoUtil;
import com.zhixing.web.api.dataobject.vo.ResultVO;
import com.zhixing.web.common.enums.DelSignEnum;
import com.zhixing.web.common.enums.IsShowEnum;
import com.zhixing.web.service.RotationService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author dzh
 * @version 1.0.0.05020
 * <p>project: d-blog</p>
 * <p>created time: 2022/05/05 15:32</p>
 * <p>describe: 首页轮播图信息API</p>
 * <p>remarks: </p>
 **/
@RestController
@RequestMapping("/rotation")
public class RotationController {

    @Resource
    private RotationService rotationService;

    /**
     * <p>描述：获取首页轮播图</p>
     *
     * @author dzh
     * @return List<Rotation> 轮播图信息列表
     * <p>时间：2022/5/5 16:07</p>
     * <p>说明1：</p>
     * <p>说明2：</p>
     **/
    @PostMapping("/list")
    @Log("获取首页轮播图")
    public ResultVO getRotationList() {

        Rotation rotation = new Rotation();

        rotation.setDelSign(DelSignEnum.DEL_SIGN_NO.getCode());
        rotation.setIsShow(IsShowEnum.IS_SHOW_YES.getCode());

        return ResultVoUtil.success(rotationService.getRotationList(rotation));
    }
}
